<?php

/**
 * 功能菜单管理widget
 *
 * @author jiang
 */

namespace Kj\Admin\Html;

use Kj\Admin\Html\Base;

class ContentList extends Base
{
    /**
     * 初始化
     *
     * @access public
     */
    public function __construct()
    {
        parent::__construct();
    }
    
    /**
     * 检测是否有权限
     *
     * @access public
     */
    private function checkPermission($module, $class, $function)
    {
        $this->hasPermission = $this->acl->checkIfHasPermission($module, $class, $function);
    }
    
    /**
     * 功能菜单编辑操作
     *
     * @access public
     */
    public function add($module, $class, $function)
    {
        $this->checkPermission($module, $class, $function);
        $html['add'] = $this->hasPermission ?
                    '<li class="right "><a id="submenubatchAddUser" target="" href="'.U('admin/content/add').'"><i class="icon-plus-sign"></i>&nbsp;添加文章</a></li>'
                        : '';
        return $html['add'];
    }
    
}
